import { Injectable } from '@nestjs/common';
import { CreateUserinfoDto } from './dto/create-userinfo.dto';
import { UpdateUserinfoDto } from './dto/update-userinfo.dto';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { userinfoEntity } from './entities/userinfo.entity'

@Injectable()
export class UserinfoService {
  constructor(
    @InjectRepository(userinfoEntity)
    private readonly userinfoRepository: Repository<userinfoEntity>,
  ) { }

  async create(createUserinfo: CreateUserinfoDto) {
    return await this.userinfoRepository.save(createUserinfo as any);
  }

  findAll() {
    return `This action returns all userinfo`;
  }

  findOne(id: number) {
    return `This action returns a #${id} userinfo`;
  }

  update(id: number, updateUserinfoDto: UpdateUserinfoDto) {
    return `This action updates a #${id} userinfo`;
  }

  remove(id: number) {
    return `This action removes a #${id} userinfo`;
  }
}
